package com.example.zhaojianxu.signin.bean

import android.content.Intent
import android.support.v4.app.FragmentActivity

abstract class BaseActivity : FragmentActivity() {

    abstract fun initView()
    abstract fun initData()

    fun toOtherActivity(className: Class<*>,intent: Intent? = null){
        if (intent == null) startActivity(Intent(this,className)) else startActivity(intent)
    }

    fun init(){
        initView()
        initData()
    }

    override fun onStart() {
        super.onStart()
        init()
    }
}
